import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/user',
            component: resolve => require(['../components/page/User.vue'], resolve),
            meta: { title: '用户' }
        },
        {
            path: '/tabledetail',
            name: 'tabledetail',
            component: resolve => require(['../components/page/TableDetail.vue'], resolve),
            meta: { title: 'sql字段' }
        },
        {
            path: '/sqlchangepass',
            name: 'sqlchangepass',
            component: resolve => require(['../components/page/SqlChangePass.vue'], resolve),
            meta: { title: '修改密码' }
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/dashboard',
                    component: resolve => require(['../components/page/Dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
                },
                {
                    //邮件设置
                    path: '/email',
                    component: resolve => require(['../components/page/Email.vue'], resolve),
                    meta: { title: '邮件设置' }
                },
                {
                    //数据链接设置
                    path: '/datalink',
                    component: resolve => require(['../components/page/DataLink.vue'], resolve),
                    meta: { title: '数据链接设置' }
                },
                {
                    //基础设置
                    path: '/basic',
                    component: resolve => require(['../components/page/Basic.vue'], resolve),
                    meta: { title: '基础设置' }
                },
                {
                    //修改密码
                    path: '/updatepassword',
                    component: resolve => require(['../components/page/UpdatePassword.vue'], resolve),
                    meta: { title: '修改密码' }
                },
                {
                    //本地数据库设置
                    path: '/localdatabase',
                    component: resolve => require(['../components/page/LocalDatabase.vue'], resolve),
                    meta: { title: '本地数据库设置' }
                },
                {
                    //部门设置
                    path: '/departmentset',
                    component: resolve => require(['../components/page/DepartmentSet.vue'], resolve),
                    meta: { title: '组织设置' }
                },
                {
                    //角色设置
                    path: '/ruleset',
                    component: resolve => require(['../components/page/ruleset.vue'], resolve),
                    meta: { title: '角色设置' }
                },
                {
                    //职责设置
                    path: '/responsiblityset',
                    component: resolve => require(['../components/page/ResponsiblitySet.vue'], resolve),
                    meta: { title: '职责设置' }
                },
                {
                    //用户设置
                    path: '/userset',
                    name: 'userset',
                    component: resolve => require(['../components/page/userset.vue'], resolve),
                    meta: { title: '用户设置' }
                },
                {
                    //权限分配
                    path: '/assignment',
                    name: 'assignment',
                    component: resolve => require(['../components/page/assignment.vue'], resolve),
                    meta: { title: '权限分配' }
                },
                {
                    //配色方案
                    path: '/colorcase',
                    component: resolve => require(['../components/page/ColorCase.vue'], resolve),
                    meta: { title: '配色方案' }
                },
                {
                    //预定义接口监控
                    path: '/portmonitor',
                    component: resolve => require(['../components/page/PortMonitor.vue'], resolve),
                    meta: { title: '预定义接口监控' }
                },
                {
                    //表盘类型设置
                    path: '/dashboardset',
                    component: resolve => require(['../components/page/DashboardSet.vue'], resolve),
                    meta: { title: '表盘类型设置' }
                },
                {
                    //表盘SQL设置
                    path: '/sqlsetting',
                    name: 'sqlsetting',
                    component: resolve => require(['../components/page/SqlSetting.vue'], resolve),
                    meta: { title: '表盘SQL设置' }
                },
                {
                    //表盘SQL设置中的新建
                    path: '/newsql',
                    name: 'newsql',
                    component: resolve => require(['../components/page/NewSql.vue'], resolve),
                    meta: { title: '新建表盘SQL' }
                },
                {
                    //FTP服务器管理
                    path: '/ftpmanage',
                    component: resolve => require(['../components/page/FtpManage.vue'], resolve),
                    meta: { title: 'FTP服务器管理' }
                },
                {
                    //文件服务器管理
                    path: '/servermanage',
                    component: resolve => require(['../components/page/ServerManage.vue'], resolve),
                    meta: { title: '文件服务器管理' }
                },
                {
                    //文件监控设置
                    path: '/filemonitor',
                    component: resolve => require(['../components/page/FileMonitor.vue'], resolve),
                    meta: { title: '文件监控设置' }
                },
                {
                    //表盘SQL设置中的新建
                    path: '/newmonitor',
                    component: resolve => require(['../components/page/NewMonitor.vue'], resolve),
                    meta: { title: '新建文件监控' }
                },
                {
                    //推送接口设置
                    path: '/pushsetting',
                    component: resolve => require(['../components/page/PushSetting.vue'], resolve),
                    meta: { title: '推送接口设置' }
                },
                {
                    //任务调度频率
                    path: '/frequency',
                    component: resolve => require(['../components/page/Frequency.vue'], resolve),
                    meta: { title: '任务调度频率' }
                },
                {
                    //调度任务
                    path: '/dispatchtask',
                    component: resolve => require(['../components/page/DispatchTask.vue'], resolve),
                    meta: { title: '调度任务' }
                },
                {
                    //调度任务日志管理
                    path: '/logmanage',
                    component: resolve => require(['../components/page/LogManage.vue'], resolve),
                    meta: { title: '调度任务日志管理' }
                }
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
        {
            path: '/404',
            component: resolve => require(['../components/page/404.vue'], resolve)
        },
        {
            path: '/403',
            component: resolve => require(['../components/page/403.vue'], resolve)
        },
        {
            path: '/lincense',
            component: resolve => require(['../components/page/Lincense.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
